package com.southminority.ethnic.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.southminority.ethnic.column.ExcelColumn;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 传承人实体类
 * 对应数据库表 inheritor
 * 
 * @author SouthMinority
 */
@Data
@TableName("inheritor")
public class Inheritor implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @ExcelColumn(name = "传承人ID", columnWidth = 10, value = "1", hidden = true)
    private Long id;

    /**
     * 关联的非遗项目ID
     */
    @ExcelColumn(name = "非遗项目ID", columnWidth = 12, nonNull = true, value = "1")
    private Long heritageId;

    /**
     * 姓名
     */
    @ExcelColumn(name = "姓名", columnWidth = 15, nonNull = true, value = "王五")
    private String name;

    /**
     * 性别
     */
    @ExcelColumn(name = "性别", columnWidth = 10, value = "男")
    private Integer gender; // DB 列 gender 为 tinyint：1-男，2-女

    /**
     * 年龄
     */
    @TableField(exist = false)
    @ExcelColumn(name = "年龄", columnWidth = 10, value = "40")
    private Integer age; // 表结构无 age，保留用于模板展示，不入库

    /**
     * 民族
     */
    @ExcelColumn(name = "民族", columnWidth = 12, value = "侗族")
    private String ethnicGroup;

    /**
     * 级别
     */
    @ExcelColumn(name = "级别", columnWidth = 12, value = "省级")
    private String level;

    /**
     * 称谓
     */
    @TableField(exist = false)
    @ExcelColumn(name = "称谓", columnWidth = 12, value = "代表性传承人")
    private String title; // 表结构无 title，仅用于展示

    /**
     * 专长
     */
    @TableField("skills")
    @ExcelColumn(name = "专长", columnWidth = 20, value = "刺绣")
    private String specialty; // 映射到 DB 列 skills

    /**
     * 个人简介
     */
    @TableField("biography")
    @ExcelColumn(name = "个人简介", columnWidth = 40, value = "简介示例")
    private String biography;

    /**
     * 头像
     */
    @ExcelColumn(name = "头像URL", columnWidth = 40, value = "https://example.com/avatar.png")
    private String avatar;

    /**
     * 联系方式
     */
    @ExcelColumn(name = "联系方式", columnWidth = 20, value = "13800000000")
    private String contactInfo;

    /**
     * 主要成就
     */
    @TableField("achievements")
    @ExcelColumn(name = "主要成就", columnWidth = 30, value = "大师级传承人")
    private String achievements;

    /**
     * 传承教学经历
     */
    @TableField("teaching_experience")
    @ExcelColumn(name = "教学经历", columnWidth = 30, value = "10年")
    private String teachingExperience;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @ExcelColumn(name = "创建时间", columnWidth = 25, hidden = true)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelColumn(name = "更新时间", columnWidth = 25, hidden = true)
    private LocalDateTime updateTime;

    /**
     * 状态：1-启用，0-禁用
     */
    @ExcelColumn(name = "状态(1启用/0禁用)", columnWidth = 15, value = "1", hidden = true)
    private Integer status;
} 
